All Questions
6 questions
3votes
1answer
104views
Sequentially find the indexes of an element into a collection
Util class to find into a collection the indexes of a given element with multiple occurrences from the first index or relative to a given index. ...
2votes
0answers
66views
Generic Graph Traverser
I have built this Generic Graph traverser, I have this implemented with DFS, I feel it will work equally fine with BFS too. What do you think of this implementation? I want help in reviewing the <...
8votes
1answer
1kviews
Transformation of abstract models
In one of my recent projects I faced the problem of transforming an abstract class into another abstract class. The classes were structured like this and are part of an api for questionnaires: ...
7votes
1answer
352views
Model simulation using Java annotations
A couple of days ago I posted my code that models systems made up of moving parts. I got several great tips and ideas and here is my latest version. My actions are now methods annotated with @Action (...
6votes
3answers
1kviews
Factory for classes unknown at compile time
I have a class called Machine. It contains a list of parts and a list of actions. The list of parts will contain instances of the ...
4votes
2answers
2kviews
Move object by one up or down algorithm in a custom order
Basically, I did an object (using hibernate) with a field called sorting_order. This field needs to be unique and I wish to swap two object by one. So one element has to be after or before the current ...